From 924a34c29839043a413801f76b6e8f66cf12a589 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Tue, 3 Mar 2015 12:45:30 -0500 Subject: [PATCH] Remove --max-slave-lag options and remnants from maintenance scripts Change-Id: Id01fb9a82bcfe1af8cbce23a9aec7eccaa0f6b21 --- maintenance/cleanupRemovedModules.php | 14 +++----------- maintenance/cleanupTable.inc | 1 - maintenance/populateCategory.php | 10 ---------- maintenance/rebuildImages.php | 1 - maintenance/updateCollation.php | 2 -- maintenance/waitForSlave.php | 11 +++-------- 6 files changed, 6 insertions(+), 33 deletions(-) diff --git a/maintenance/cleanupRemovedModules.php b/maintenance/cleanupRemovedModules.php index e1d0ed6e5d..a4e66ca63b 100644 --- a/maintenance/cleanupRemovedModules.php +++ b/maintenance/cleanupRemovedModules.php @@ -36,13 +36,6 @@ class CleanupRemovedModules extends Maintenance { parent::__construct(); $this->mDescription = 'Remove cache entries for removed ResourceLoader modules from the database'; $this->addOption( 'batchsize', 'Delete rows in batches of this size. Default: 500', false, true ); - $this->addOption( - 'max-slave-lag', - 'If the slave lag exceeds this many seconds, wait until it drops below this value. ' - . 'Default: 5', - false, - true - ); } public function execute() { @@ -51,7 +44,6 @@ class CleanupRemovedModules extends Maintenance { $moduleNames = $rl->getModuleNames(); $moduleList = implode( ', ', array_map( array( $dbw, 'addQuotes' ), $moduleNames ) ); $limit = max( 1, intval( $this->getOption( 'batchsize', 500 ) ) ); - $maxlag = intval( $this->getOption( 'max-slave-lag', 5 ) ); $this->output( "Cleaning up module_deps table...\n" ); $i = 1; @@ -63,7 +55,7 @@ class CleanupRemovedModules extends Maintenance { $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; - wfWaitForSlaves( $maxlag ); + wfWaitForSlaves(); } while ( $numRows > 0 ); $this->output( "done\n" ); @@ -77,7 +69,7 @@ class CleanupRemovedModules extends Maintenance { $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; - wfWaitForSlaves( $maxlag ); + wfWaitForSlaves(); } while ( $numRows > 0 ); $this->output( "done\n" ); @@ -90,7 +82,7 @@ class CleanupRemovedModules extends Maintenance { $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; - wfWaitForSlaves( $maxlag ); + wfWaitForSlaves(); } while ( $numRows > 0 ); $this->output( "done\n" ); } diff --git a/maintenance/cleanupTable.inc b/maintenance/cleanupTable.inc index cbd1be6b80..f6259e95c8 100644 --- a/maintenance/cleanupTable.inc +++ b/maintenance/cleanupTable.inc @@ -37,7 +37,6 @@ class TableCleanup extends Maintenance { ); protected $dryrun = false; - protected $maxLag = 10; # if slaves are lagged more than 10 secs, wait public $batchSize = 100; public $reportInterval = 100; diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index ab0ca1ede4..66553bc6bf 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -57,12 +57,6 @@ TEXT; false, true ); - $this->addOption( - 'max-slave-lag', - 'If slave lag exceeds this many seconds, wait until it drops before continuing. Default: 10', - false, - true - ); $this->addOption( 'throttle', 'Wait this many milliseconds after each category. Default: 0', @@ -74,13 +68,9 @@ TEXT; public function execute() { $begin = $this->getOption( 'begin', '' ); - $maxSlaveLag = $this->getOption( 'max-slave-lag', 10 ); $throttle = $this->getOption( 'throttle', 0 ); $force = $this->getOption( 'force', false ); - $this->doPopulateCategory( $begin, $maxSlaveLag, $throttle, $force ); - } - private function doPopulateCategory( $begin, $maxlag, $throttle, $force ) { $dbw = wfGetDB( DB_MASTER ); if ( !$force ) { diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 5a1496786f..8e3997878a 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -59,7 +59,6 @@ class ImageBuilder extends Maintenance { public function execute() { $this->dbw = wfGetDB( DB_MASTER ); - $this->maxLag = 10; # if slaves are lagged more than 10 secs, wait $this->dryrun = $this->hasOption( 'dry-run' ); if ( $this->dryrun ) { $GLOBALS['wgReadOnly'] = 'Dry run mode, image upgrades are suppressed'; diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 342ffbad65..5cf8afa941 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -24,8 +24,6 @@ * @author Aryeh Gregor (Simetrical) */ -#$optionsWithArgs = array( 'begin', 'max-slave-lag' ); - require_once __DIR__ . '/Maintenance.php'; /** diff --git a/maintenance/waitForSlave.php b/maintenance/waitForSlave.php index c9b1abba4c..50665ef2fb 100644 --- a/maintenance/waitForSlave.php +++ b/maintenance/waitForSlave.php @@ -1,6 +1,6 @@ addArg( 'maxlag', 'How long to wait for the slaves, default 10 seconds', false ); - } - public function execute() { - wfWaitForSlaves( $this->getArg( 0, 10 ) ); + wfWaitForSlaves(); } } -- 2.20.1